Optimal. Leaf size=61 \[ -\frac{b^2 \tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)^{5/2}}-\frac{\cot ^3(x)}{3 (a+b)}-\frac{(a+2 b) \cot (x)}{(a+b)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0802187, antiderivative size = 61, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {3191, 390, 205} \[ -\frac{b^2 \tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)^{5/2}}-\frac{\cot ^3(x)}{3 (a+b)}-\frac{(a+2 b) \cot (x)}{(a+b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3191
Rule 390
Rule 205
Rubi steps
\begin{align*} \int \frac{\csc ^4(x)}{a+b \cos ^2(x)} \, dx &=-\operatorname{Subst}\left (\int \frac{\left (1+x^2\right )^2}{a+(a+b) x^2} \, dx,x,\cot (x)\right )\\ &=-\operatorname{Subst}\left (\int \left (\frac{a+2 b}{(a+b)^2}+\frac{x^2}{a+b}+\frac{b^2}{(a+b)^2 \left (a+(a+b) x^2\right )}\right ) \, dx,x,\cot (x)\right )\\ &=-\frac{(a+2 b) \cot (x)}{(a+b)^2}-\frac{\cot ^3(x)}{3 (a+b)}-\frac{b^2 \operatorname{Subst}\left (\int \frac{1}{a+(a+b) x^2} \, dx,x,\cot (x)\right )}{(a+b)^2}\\ &=-\frac{b^2 \tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{\sqrt{a} (a+b)^{5/2}}-\frac{(a+2 b) \cot (x)}{(a+b)^2}-\frac{\cot ^3(x)}{3 (a+b)}\\ \end{align*}
Mathematica [A] time = 0.200132, size = 59, normalized size = 0.97 \[ \frac{b^2 \tan ^{-1}\left (\frac{\sqrt{a} \tan (x)}{\sqrt{a+b}}\right )}{\sqrt{a} (a+b)^{5/2}}-\frac{\cot (x) \left ((a+b) \csc ^2(x)+2 a+5 b\right )}{3 (a+b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.038, size = 65, normalized size = 1.1 \begin{align*}{\frac{{b}^{2}}{ \left ( a+b \right ) ^{2}}\arctan \left ({a\tan \left ( x \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}}-{\frac{1}{ \left ( 3\,a+3\,b \right ) \left ( \tan \left ( x \right ) \right ) ^{3}}}-{\frac{a}{ \left ( a+b \right ) ^{2}\tan \left ( x \right ) }}-2\,{\frac{b}{ \left ( a+b \right ) ^{2}\tan \left ( x \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.97951, size = 936, normalized size = 15.34 \begin{align*} \left [\frac{4 \,{\left (2 \, a^{3} + 7 \, a^{2} b + 5 \, a b^{2}\right )} \cos \left (x\right )^{3} + 3 \,{\left (b^{2} \cos \left (x\right )^{2} - b^{2}\right )} \sqrt{-a^{2} - a b} \log \left (\frac{{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \,{\left (4 \, a^{2} + 3 \, a b\right )} \cos \left (x\right )^{2} + 4 \,{\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{3} - a \cos \left (x\right )\right )} \sqrt{-a^{2} - a b} \sin \left (x\right ) + a^{2}}{b^{2} \cos \left (x\right )^{4} + 2 \, a b \cos \left (x\right )^{2} + a^{2}}\right ) \sin \left (x\right ) - 12 \,{\left (a^{3} + 3 \, a^{2} b + 2 \, a b^{2}\right )} \cos \left (x\right )}{12 \,{\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3} -{\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}, \frac{2 \,{\left (2 \, a^{3} + 7 \, a^{2} b + 5 \, a b^{2}\right )} \cos \left (x\right )^{3} + 3 \,{\left (b^{2} \cos \left (x\right )^{2} - b^{2}\right )} \sqrt{a^{2} + a b} \arctan \left (\frac{{\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a}{2 \, \sqrt{a^{2} + a b} \cos \left (x\right ) \sin \left (x\right )}\right ) \sin \left (x\right ) - 6 \,{\left (a^{3} + 3 \, a^{2} b + 2 \, a b^{2}\right )} \cos \left (x\right )}{6 \,{\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3} -{\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc ^{4}{\left (x \right )}}{a + b \cos ^{2}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.21711, size = 122, normalized size = 2. \begin{align*} \frac{{\left (\pi \left \lfloor \frac{x}{\pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (a\right ) + \arctan \left (\frac{a \tan \left (x\right )}{\sqrt{a^{2} + a b}}\right )\right )} b^{2}}{{\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt{a^{2} + a b}} - \frac{3 \, a \tan \left (x\right )^{2} + 6 \, b \tan \left (x\right )^{2} + a + b}{3 \,{\left (a^{2} + 2 \, a b + b^{2}\right )} \tan \left (x\right )^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]